home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / ka9q / kit_src / mk_fing.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-03  |  1.8 KB  |  50 lines

  1. /*    (C) Copyright 1991 Dave Fritsche (wb8zxu), All Rights Reserved.
  2.  * 
  3.  *    Redistribution and use in source and binary forms are permitted for
  4.  *    non-commercial use, provided that the above copyright notice and this
  5.  *    paragraph are duplicated in all such forms.  THIS SOFTWARE IS PROVIDED
  6.  *    ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
  7.  *    WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND
  8.  *    FITNESS FOR A PARTICULAR PURPOSE.
  9.  */
  10. #include <stdio.h>
  11. #include "screen.h"
  12.  
  13. mk_fing()
  14. {
  15.     FILE *finger;
  16.     unsigned char buf[128];
  17.  
  18.     sprintf(buf, "%s\\finger\\%s", path, callsign);
  19.     if (debug)
  20.     {
  21.         printf("***> finger file (%s):\n", buf);
  22.         finger = stdout;
  23.     }
  24.     else
  25.         if ( (finger = fopen(buf, "w")) == NULL )
  26.         {
  27.             printf("\nCan't open \"%s\" for write, aborting!\n\n", buf);
  28.             exit(-1);
  29.         }
  30.  
  31.     fprintf(finger, "*********************************************************\n");
  32.     fprintf(finger, "     Greetings, welcome to the PC of %s\n", name);
  33.     fprintf(finger, "     running the KA9Q TCP/IP package:  NOS\n");
  34.     fprintf(finger, "*********************************************************\n");
  35.     fprintf(finger, "     User:           %s\n", callsign);
  36.     fprintf(finger, "     IP Address:     [%ld.%ld.%ld.%ld]\n",
  37.         ((ip >> 24) & 0xff), ((ip >> 16) & 0xff), ((ip >> 8) & 0xff),
  38.         (ip & 0xff) );
  39.     fprintf(finger, "     Real Name:      %s\n", name);
  40.     fprintf(finger, "     Phone:          %s\n", phone);
  41.     fprintf(finger, "     Address:        %s\n", street);
  42.     fprintf(finger, "                     %s, %s  %s\n", city, state, zip);
  43.     fprintf(finger, "*********************************************************\n");
  44.     fprintf(finger, "     Please address any SMTP mail to:  %s@%s\n", callsign, callsign);
  45.     fprintf(finger, "*********************************************************\n");
  46.  
  47.     if (!debug)
  48.         fclose(finger);
  49. }
  50.